/********************************************
* Copyrigt (C) rumi
* Module: drv_iic.h
*********************************************/
#ifndef drv_iic_H
#define drv_iic_H
#include "esp_log.h"
#include "mcu_config.h"
#include "drv_pincontrol.h"

#define I2C_WR	0	// write
#define I2C_RD	1	// read
 

#define CycleCount 28

typedef struct {
	PinConfig_DrvDef *SCL;
	PinConfig_DrvDef *SDA;
	uint16_t SpeedDelay;
}iic_Node;

uint8_t Drv_IIC_WriteReg(iic_Node *iic,uint8_t addr,uint8_t regster_addr,uint8_t Data);
uint8_t Drv_IIC_Read_Reg( iic_Node *iic,uint8_t addr,uint16_t _usAddress);
uint16_t Drv_IIC_ReadTwoByte( iic_Node *iic,uint8_t addr,uint16_t _usAddress);
uint8_t Drv_IIC_WriteByte(iic_Node *iic,uint8_t addr,uint8_t regster_addr,uint8_t *pBuffer,uint8_t Length);
uint8_t Drv_IIC_ReadByte( iic_Node *iic,uint8_t addr,uint16_t _usAddress,uint8_t *buff,uint8_t _usSize);
#endif
/*************End of file*******************/



